//
//  CurrentBlock.h
//  CarDemo
//
//  Created by huang kun on 8/9/10.
//  Copyright 2010 UESTC. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "cocos2d.h"
#import "Block.h"
#import "Constant.h"

@protocol SetBlockDelegate<NSObject>

- (BOOL) addBlock:(Block *)block position:(CGPoint)position;
- (CGPoint) convertToGridPosition:(CGPoint)position;
- (BOOL) shouldPlantAtPosition:(CGPoint)position;

@end



@interface  CurrentBlock: CCSprite <CCTargetedTouchDelegate> {
	id<SetBlockDelegate>delegate;
	Block *roadBlock;
	NextBlock *nextBlock;
	
	int type;
	int blockNum;
	int usedBlock;
	BOOL avaliable;
	
	BOOL shouldPlant;	//能否种植
	BOOL draging;		//正在拖动
	CGPoint dragingPosition;//拖动的当前位置
	
}

@property (nonatomic, assign) id<SetBlockDelegate> delegate;
@property int type;
@property int blockNum;
@property BOOL avaliable;

- (void) update;

@end
